package com.ag.bean;

import java.util.Date;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 * TbPropose entity.
 * 
 * @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "TB_PROPOSE", schema = "dbo", catalog = "AGDB")
public class TbPropose implements java.io.Serializable {

	// Fields

	private String ppId;			//成批id
	private TbUser tbUserByPViceCommander;	//副总指挥		
	private TbUser tbUserByPTeamLeader;			//查控工作组组长	
	private TbUser tbUserByPCommander;		//总指挥
	private TbEvent tbEvent;				//事件
	private TbUserDept tbUserDeptByPImplementPlan;	//实施应急预案部门
	private TbUserDept tbUserDeptByPAssistDept;		//协助部门
	private String paContent;						//成批内容
	private Date paTime;
	private String PEmergency;						//是否即上报市应急办
	private String PGovernment;						//是否即上报亚组委
	private String PAsianGames;						//是否即上报亚组
	private String PBureau;							//是否即上报省局
	private String PRelease;						//是否即对外发布
	private String PLeaderComments;					//带班领导意见
	private String a;
	private String b;
	private String c;
	private String d;
	private String e;    ////实施应急预案部门，可多个部门一起
	private String f;	 // 呈批级数，1为带班领导，2为值班领导，向上呈批+1,同意下级-1
	private Set<TbProposeRecord> tbProposeRecords = new HashSet<TbProposeRecord>(
			0);

	// Constructors

	/** default constructor */
	public TbPropose() {
	}

	/** minimal constructor */
	public TbPropose(String ppId) {
		this.ppId = ppId;
	}

	/** full constructor */
	public TbPropose(String ppId, TbUser tbUserByPViceCommander,
			TbUser tbUserByPTeamLeader, TbUser tbUserByPCommander,
			TbEvent tbEvent, TbUserDept tbUserDeptByPImplementPlan,
			TbUserDept tbUserDeptByPAssistDept, String paContent, Date paTime,
			String PEmergency, String PGovernment, String PAsianGames,
			String PBureau, String PRelease, String PLeaderComments, String a,
			String b, String c, Set<TbProposeRecord> tbProposeRecords) {
		this.ppId = ppId;
		this.tbUserByPViceCommander = tbUserByPViceCommander;
		this.tbUserByPTeamLeader = tbUserByPTeamLeader;
		this.tbUserByPCommander = tbUserByPCommander;
		this.tbEvent = tbEvent;
		this.tbUserDeptByPImplementPlan = tbUserDeptByPImplementPlan;
		this.tbUserDeptByPAssistDept = tbUserDeptByPAssistDept;
		this.paContent = paContent;
		this.paTime = paTime;
		this.PEmergency = PEmergency;
		this.PGovernment = PGovernment;
		this.PAsianGames = PAsianGames;
		this.PBureau = PBureau;
		this.PRelease = PRelease;
		this.PLeaderComments = PLeaderComments;
		this.a = a;
		this.b = b;
		this.c = c;
		this.tbProposeRecords = tbProposeRecords;
	}

	// Property accessors
	@Id
	@Column(name = "PP_ID", unique = true, nullable = false, length = 10)
	public String getPpId() {
		return this.ppId;
	}

	public void setPpId(String ppId) {
		this.ppId = ppId;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "P_VICE_COMMANDER")
	public TbUser getTbUserByPViceCommander() {
		return this.tbUserByPViceCommander;
	}

	public void setTbUserByPViceCommander(TbUser tbUserByPViceCommander) {
		this.tbUserByPViceCommander = tbUserByPViceCommander;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "P_TEAM_LEADER")
	public TbUser getTbUserByPTeamLeader() {
		return this.tbUserByPTeamLeader;
	}

	public void setTbUserByPTeamLeader(TbUser tbUserByPTeamLeader) {
		this.tbUserByPTeamLeader = tbUserByPTeamLeader;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "P_COMMANDER")
	public TbUser getTbUserByPCommander() {
		return this.tbUserByPCommander;
	}

	public void setTbUserByPCommander(TbUser tbUserByPCommander) {
		this.tbUserByPCommander = tbUserByPCommander;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "E_ID")
	public TbEvent getTbEvent() {
		return this.tbEvent;
	}

	public void setTbEvent(TbEvent tbEvent) {
		this.tbEvent = tbEvent;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "P_IMPLEMENT_PLAN")
	public TbUserDept getTbUserDeptByPImplementPlan() {
		return this.tbUserDeptByPImplementPlan;
	}

	public void setTbUserDeptByPImplementPlan(
			TbUserDept tbUserDeptByPImplementPlan) {
		this.tbUserDeptByPImplementPlan = tbUserDeptByPImplementPlan;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "P_ASSIST_DEPT")
	public TbUserDept getTbUserDeptByPAssistDept() {
		return this.tbUserDeptByPAssistDept;
	}

	public void setTbUserDeptByPAssistDept(TbUserDept tbUserDeptByPAssistDept) {
		this.tbUserDeptByPAssistDept = tbUserDeptByPAssistDept;
	}

	@Column(name = "PA_CONTENT", length = 1024)
	public String getPaContent() {
		return this.paContent;
	}

	public void setPaContent(String paContent) {
		this.paContent = paContent;
	}

	@Temporal(TemporalType.DATE)
	@Column(name = "PA_TIME", length = 23)
	public Date getPaTime() {
		return this.paTime;
	}

	public void setPaTime(Date paTime) {
		this.paTime = paTime;
	}

	@Column(name = "P_EMERGENCY", length = 1)
	public String getPEmergency() {
		return this.PEmergency;
	}

	public void setPEmergency(String PEmergency) {
		this.PEmergency = PEmergency;
	}

	@Column(name = "P_GOVERNMENT", length = 1)
	public String getPGovernment() {
		return this.PGovernment;
	}

	public void setPGovernment(String PGovernment) {
		this.PGovernment = PGovernment;
	}

	@Column(name = "P_ASIAN_GAMES", length = 1)
	public String getPAsianGames() {
		return this.PAsianGames;
	}

	public void setPAsianGames(String PAsianGames) {
		this.PAsianGames = PAsianGames;
	}

	@Column(name = "P_BUREAU", length = 1)
	public String getPBureau() {
		return this.PBureau;
	}

	public void setPBureau(String PBureau) {
		this.PBureau = PBureau;
	}

	@Column(name = "P_RELEASE", length = 1)
	public String getPRelease() {
		return this.PRelease;
	}

	public void setPRelease(String PRelease) {
		this.PRelease = PRelease;
	}

	@Column(name = "P_LEADER_COMMENTS", length = 4000)
	public String getPLeaderComments() {
		return this.PLeaderComments;
	}

	public void setPLeaderComments(String PLeaderComments) {
		this.PLeaderComments = PLeaderComments;
	}

	@Column(name = "A", length = 60)
	public String getA() {
		return this.a;
	}

	public void setA(String a) {
		this.a = a;
	}

	@Column(name = "B", length = 60)
	public String getB() {
		return this.b;
	}

	public void setB(String b) {
		this.b = b;
	}

	@Column(name = "C", length = 60)
	public String getC() {
		return this.c;
	}

	public void setC(String c) {
		this.c = c;
	}
	
	@Column(name = "D", length = 10)
	public String getD() {
		return this.d;
	}

	public void setD(String d) {
		this.d = d;
	}
	
	@Column(name = "E", length = 100)
	public String getE() {
		return this.e;
	}
	
	public void setE(String e) {
		this.e = e;
	}
	
	@Column(name = "F", length = 100)
	public String getF() {
		return this.f;
	}
	
	public void setF(String f) {
		this.f = f;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "tbPropose")
	@javax.persistence.OrderBy("newPpId")
	public Set<TbProposeRecord> getTbProposeRecords() {
		return this.tbProposeRecords;
	}

	public void setTbProposeRecords(Set<TbProposeRecord> tbProposeRecords) {
		this.tbProposeRecords = tbProposeRecords;
	}

}